{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/hyb_o2o/template/public/ygcsslist.css">
<style type="text/css">
    .yg5_key>div{float: left;line-height: 34px;}

    .store_td1{height: 45px;}

    .store_list_img{width: 60px;height: 60px;}

    .yg5_tabel{border-color: #e5e5e5;outline: 1px solid #e5e5e5;text-align: center;}

    .yg5_tr2>td{padding: 15px;border: 1px solid #e5e5e5;}

    .yg5_tr1>td{

        border: 1px solid #e5e5e5;
        background-color: #FAFAFA;

        font-weight: bold;

    }

    .yg5_btn{background-color: #EEEEEE;color: #333;border: 1px solid #E4E4E4;border-radius: 6px;width: 100px;height: 34px;}
    .check_img{width: 45px;height: 45px;}
    .ygrow{margin-top: 20px;}
    .yghuise{background-color: grey;color: white;}
    .yghuise:hover{background-color: grey;color: white;}
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li {if $op == 'display'} class="active" {/if}><a href="{php echo $this->createWebUrl('gonggao',array('op'=>'display'))}">公告列表</a></li>
    <li {if $op == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('gonggao',array('op'=>'post'))}">添加公告</a></li>
</ul>
{if $op =="display"}
<div class="panel panel-default" style="margin-top: 20px;">
    <div class="panel-heading"></div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1">
                        <td >排序</td>
                        <td>公告内容</td>
                        <td>操作</td>
                    </tr>
                    {loop $list $item}
                    <tr class="yg5_tr2">
                        <td>
                            {$item['id']}
                        </td>
                        <td>
                            {$item['title']}
                        </td>
                        <td >
                            <a href="{php echo $this->createWeburl('gonggao', array('id' => $item['id'], 'op' =>'post'))}" class="storespan btn btn-xs">
                                <span class="fa fa-pencil"></span>
                                <span class="bianji">编辑
                                    <span class="arrowdown"></span>
                                </span>
                            </a>
                            <a href="{php echo $this->createWeburl('gonggao', array('id' => $item['id'],'op' => 'delete'))}" class="storespan btn btn-xs">
                                <span class="fa fa-trash-o"></span>
                                <span class="bianji">删除
                                    <span class="arrowdown"></span>
                                </span>
                            </a>
                        </td>
                    </tr>
                    {/loop}
                </table>
            </div>
        </div>
    </div>
</div>
<div class="text-right we7-margin-top">
     {$pager}
</div>
{/if}
{if $op == "post"}
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                添加公告
            </div>
            <div class="form-group" style="margin-top: 20px;">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">公告标题</label>
                <div class="col-sm-9">
                    <input type="text" name="title" value="{$items['title']}" class="form-control"  />
                </div>
            </div>
            <div class="form-group" style="margin-top: 20px;">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">公告内容</label>
                <div class="col-sm-9">
                    {php echo tpl_ueditor('content', $items['content']);}
                </div>
            </div>
        <div class="form-group" style="margin-top: 20px; margin-left: 20px;">
            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
    </form>
</div>
{/if}
<script type="text/javascript">
    $(function(){
        $("#frame-13").show();
        $("#yframe-13").addClass("wyactive");
    })
</script>
{template "common/footer"}